
const { flowRight } = require("lodash")

const reverse = arr => arr.reverse()
const first = arr => arr[0]
const toUpper = arr => arr.toUpperCase()

const fn = flowRight(toUpper, first, reverse)

const arr = ['aa', 'bb', 'cc', 'dd']

console.log(fn(arr))